import numpy as np
# pip install matplotlib
import matplotlib.pyplot as plt


delt_T = 0.001
A = np.zeros((5000,), dtype=np.float32)  # 5000个数
t = [i for i in range(0, 5000, 1)]  # 5000个数
# A=zeros(1,5000);
T = 1
y0 = 0
yk_1 = y0
u = 0
# for i = 1: 1: 5000
for i in range(0, 5000):
    if(i == 1000):
        u = 1
    yk = (yk_1+delt_T/T*u)/(1+delt_T/T)
    yk_1 = yk
    A[i] = yk

plt.title("title")  # 括号当中输入标题的名称
plt.plot(t, A)
plt.show()

# t = 0: 0.001: 4.999
# hold on
# plot(t, A)
